<script type="text/javascript">
    function checkAllList(){
       var theform = document.frmForm;
       var n = parseInt(theform.iCount.value);

       for(i=0; i<n; i++){
           if(theform.checkAll.checked){
           	  	document.getElementById("checkItem"+i).checked=true;
           }else{
           		document.getElementById("checkItem"+i).checked=false;
           }
       }
       return true;
    }

    function search(){
    	var theform = document.frmForm;
    	theform.submit();
    	return true;
    }

    function deleteAction(value){
    	var theform = document.frmForm;
    	theform.idValue.value = value;
    	theform.action = "<{$APPLICATION_URL}>/Admin/Faq/delete";
    	theform.submit();
    	return true;
    }
</script>
<form method="post" action="<{$APPLICATION_URL}>/Admin/Faq/index"
	name="frmForm">
	<div class="box">
		<div class="header">Faq Topics</div>
		<div class="body">
			<div class="panes">
				<a href="<{$APPLICATION_URL}>/Admin/Faq/add"> Add new
					FAQ </a> <br>
				<table cellpadding="0" cellspacing="0" border="0"
					class="grid_table wf">
					<thead>
						<tr>
							<th width="10">
								<div>
									<input name="checkAll" id="checkAll"
										onclick="checkAllList(this);" type="checkbox">
								</div>
							</th>
							<th width="10">ID</th>
							<th>Question</th>
							<th>Answer</th>
							<th>Category</th>
							<th>Status</th>
							<th>Action</th>
						</tr>
					</thead>
					<tbody>
						<{assign var = i value =0}> <{foreach name=outer item=faqEntity
						from=$itemList}>
						<tr class="gradeX">
							<td>
								<div>
									<input name="checkItem<{$i}>" id="checkItem<{$i}>"
										value="<{$faqEntity->id}>" type="checkbox">
								</div>
							</td>
							<td><{$faqEntity->id}></td>
							<td><{$faqEntity->question}></td>
							<td><{$faqEntity->answer}></td>
							<td><{$faqEntity->getCategoryName()}></td>
							<td class="center">
								<div><{$faqEntity->getStatusName()}></div>
							</td>
							<td class="center">
								<div style="float: right;">
									<a href="javascript:void(0);"
										onclick="if (confirm('Are you sure you want to delete this record?')) { deleteAction(<{$faqEntity->id}>); } else { return false; }"
										class="notboldText"> <img
										src="<{$APPLICATION_URL}>/Themes/Default/Images/b_drop.png"
										alt="" /> </a> <a
										href="<{$APPLICATION_URL}>/Admin/Faq/edit/id/<{$faqEntity->id}>">
										<img
										src="<{$APPLICATION_URL}>/Themes/Default/Images/b_edit.png"
										alt="" /> </a>

								</div>
							</td>
						</tr>
						<{assign var = i value = $i+1}> <{/foreach}>
					</tbody>
					<tr>
						<td colspan="13" align="right">
							<div style="float: right;">
								<input class="button" name="delete" value=" Delete "
									onclick="javascript: var theform = document.frmForm; theform.action = '<{$APPLICATION_URL}>/Admin/Faq/deleteall'; theform.submit(); return true;"
									type="button">
							</div>
						</td>
					</tr>
				</table>


			</div>
		</div>
	</div>
	<input type="hidden" name="iCount" id="iCount" value="<{$i}>" /> <input
		type="hidden" name="idValue" id="idValue" value="" /> <input
		type="hidden" name="masterId" id="masterId"
		value="<{$this->masterId}>" /> <input type="hidden" id="actionForm"
		name="actionForm" value=""> <input type="hidden" id="actionKey"
		name="actionKey" value="<{$actionKey}>">
</form>
